package com.cqie.hospitalescort.service;

import com.cqie.hospitalescort.DTO.OrderDTO;
import com.cqie.hospitalescort.VO.OrderVO;
import com.cqie.hospitalescort.entity.MedOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.security.access.prepost.PreAuthorize;

import java.util.List;

/**
 * <p>
 * 订单信息 服务类
 * </p>
 *
 * @author gdy
 * @since 2025-02-18
 */
public interface MedOrderService extends IService<MedOrder> {

    List<OrderVO> orderList(Integer status, Boolean isAdmin,Boolean isEscort);

    OrderVO detail(String orderCode);

    String startOrder(OrderDTO dto);

//    @PreAuthorize(value = "hasRole('ROLE_ESCORT')")
    void takeOrder(String orderCode);

    void payOrder(String orderCode);

    void completeAppointment(String orderCode);

    @PreAuthorize(value = "hasAnyRole('ROLE_ADMIN, ROLE_USER')")
    void cancelOrder(String orderCode);

    @PreAuthorize(value = "hasRole('ROLE_ADMIN')")
    void deleteOrder(String orderCode);

}
